package com.yejiarong.elasticsearch.api.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author YeJR
 */
@Getter
@AllArgsConstructor
public enum Result {

    Created("created"),

    Updated("updated"),

    Deleted("deleted"),

    NotFound("not_found"),

    NoOp("noop"),

    ;
    private final String value;

    public static Result fromValue(String v) {
        for (Result c : Result.values()) {
            if (c.value.equals(v)) {
                return c;
            }
        }
        return null;
    }
}
